#include "UdpClient.hpp"
#include <memory>

void Usage(std::string proc)
{
    std::cout << "\n[Usage]\n" << "\t" << proc << "\tserverip\t\tserverport\n" << std::endl;
    // std::cout << "\n[Usage]\n\t" << proc << "\tlocalport\n" << std::endl;
    exit(USAGE_ERR);
}

int main(int argc, char* argv[])
{
    if(argc < 3)
    {
        Usage(argv[0]);
    }


    std::string serverip = argv[1];
    uint16_t serverport = atoi(argv[2]);

    std::unique_ptr<UdpClient> uc(new UdpClient(serverip, serverport));

    uc->init();
    uc->run();

    return 0;
}